<!DOCTYPE html>
<!-- Reader -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/iconfont.css">
    <link rel="stylesheet" href="css/reader_welcome.css">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
    <title>Document</title>
    <script type="text/javascript">
        var username=""
        function getQueryString(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        function home(){
            window.location.href = "/reader_searchbook(in)?name=" + getQueryString("name") + "&phone=" + getQueryString("phone");
        }
        function readerhome(){
            window.location.href = "/readerborrowinfo?name=" + getQueryString("name") + "&phone=" + getQueryString("phone");
        }
        function reader(){
            window.location.href = "/readerfinerecord?name=" + getQueryString("name") + "&phone=" + getQueryString("phone");
        }
        $(function(){
            var label=getQueryString("name");
            var phone=getQueryString("phone");
// <<<<<<< Updated upstream
            window.username=label
            console.log(label);
// =======
// >>>>>>> Stashed changes
            $("#name").html(label);
            /*
            setTimeout(function () {
                $.post("/userchanged",{username:window.username},function (result) {
                    window.location.href="/welcome?name="+result.username
                })
            },500)
             */
            $.ajax({
                url : "/sendpassword/searchBookOverdue",
                type : "post",
                data: {
                    "phone":phone
                },
                success : function(data){
                    if(data == "no1"){
                        console.log("没有书过期");
                    }
                }
            })
        })
        function aboutMeClick() {
            //window.open('/readerchangeinfo?username='+window.username,"_target")
            window.location.href='/readerchangeinfo?username='+window.username + "&phone=" + getQueryString("phone");
        }
    </script>
</head>
<body>
    <div class="main clearfix">
        <header class="header clearfix">
            <i class="iconfont icon-yun"></i>
            <i>Library</i>
            <i class="iconfont icon-yonghu"></i>
            <!--<i class="name" th:text="${data.getRname()}"></i>-->
            <i id="name" ></i>
            <a href="/reader_searchbook(no)" class="logout">Logout</a>
            <ul class="topmenu clearfix">
                <li><span id="home" onclick="home()" style="color: #fff;cursor: pointer">Home</span></li>
                <li><span id="reader" onclick="reader()" style="color: #fff;cursor: pointer">Fine</span></li>
                <li><span id="readerhome" onclick="readerhome()" style="color: #fff;cursor: pointer">Borrow</span></li>
                <li><a onclick="aboutMeClick()" href="javascript:">About me</a></li>
            </ul>
        </header>

        <div class="welcome">
            <p>Welcome,Reader!</p>
        </div>

        <footer class="footer">
            <div class="mandarin">
                <img src="images/mandarin.png" alt="">
            </div>
            <p>Shan ICP number18018134 | Powered by 1713011</p>
        </footer>
    </div>
</body>
</html>